package com.wolfalpha.utron.service.impl;

import com.wolfalpha.utron.app.AppContext;
import com.wolfalpha.utron.net.URLs;
import com.wolfalpha.utron.service.AppService;
import com.wolfalpha.utron.utils.JsonUtils;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by luodon on 15/8/20.
 */
public class AppServiceImpl implements AppService {

    @Override
    public boolean sendFeedback(String content) {
        Map<String, String> mp = new HashMap<>();
        mp.put("user_id", String.valueOf(AppContext.getInstance().getUserId()));
        mp.put("content", content);
        String result = AppContext.getApiClient().sendPostResquest(URLs.APP_URL + "feedback", mp);
        if (result == null) {
            return false;
        }
        System.out.println(result);
        return JsonUtils.getRet(result) == 200;
    }

}
